#pragma once

#include <iostream>
#include "EventListener.h"
#include "CustomEvents.h"
#include "CustomEventArgs.h"

class Form
{
public:
	bool delegateLoad(void* obj, const cevent::EventArgs* args) {
		CustomEventArgs* custom_args = (CustomEventArgs*)args;
		printf("Form::delegateLoad [%s]\n", custom_args->str.c_str());
		return false;
	}

	bool delegateComliteLoad(void* obj, const cevent::EventArgs* args) {
		CustomEventArgs* custom_args = (CustomEventArgs*)args;
		printf("Form::delegateComleteLoad [%s]\n", custom_args->str.c_str());
		return false;
	}

	void Loading(std::string str) {
		cevent::EventController::GetInst().GenerateEvent<EventStartLoadListener>(this, new CustomEventArgs(str + " startLoad"));
		//loading Form
		for (int i = 0; i < 10000; i++)
		{

		}
		//loading Form
		cevent::EventController::GetInst().GenerateEvent<EventCompleteLoadListener>(this, new CustomEventArgs(str + " completeLoad"));
	};
};

